package com.np.moneylover;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ToggleButton;

public class No extends Activity implements OnClickListener {
	EditText txtnguoichomuon=null;
	EditText txtsotienmuon=null;
	EditText txtghichumuon=null;
	ToggleButton tgblai=null;
	EditText txtlaisuatmuon=null;
	EditText txtngaymuon=null;
	EditText txtngaytrano=null;
	Button btnthemluu=null;
	Button btnluu=null;
	private Calendar cal;
	private Calendar cal1;
	private Date dateFinish;
	private Date dataFinish2;
        @Override
        protected void onCreate(Bundle savedInstanceState) {
        	// TODO Auto-generated method stub
        	super.onCreate(savedInstanceState);
        	this.setContentView(R.layout.no);
        	txtnguoichomuon=(EditText)findViewById(R.id.txtnguoichomuon);
        	txtsotienmuon=(EditText)findViewById(R.id.txtsotienmuon);
        	txtghichumuon=(EditText)findViewById(R.id.txtghichumuon);
        	txtlaisuatmuon=(EditText)findViewById(R.id.txtlaisuatmuon);
        	txtngaymuon=(EditText)findViewById(R.id.txtlaisuat);
        	txtngaytrano=(EditText)findViewById(R.id.dtpngaytrano);
        	tgblai=(ToggleButton)findViewById(R.id.tgblaimuon);
        	btnthemluu=(Button)findViewById(R.id.btnthemluunno);
        	btnluu=(Button)findViewById(R.id.btnluuno);
        	btnthemluu.setOnClickListener(this);
        	btnluu.setOnClickListener(this);
        	tgblai.setOnClickListener(this);
        	loadreference();
        }
		private void loadreference() {
			// TODO Auto-generated method stub
			// TODO Auto-generated method stub
			cal = Calendar.getInstance();
			cal1 = Calendar.getInstance();
			SimpleDateFormat dft = null;
			// Định dạng ngày / tháng /năm
			dft = new SimpleDateFormat("dd/MM/yyyy", Locale.getDefault());
			String strDate = dft.format(cal.getTime());
			String strDate1=dft.format(cal1.getTime());
			// hiển thị lên giao diện
			txtngaymuon.setText(strDate);
			txtngaytrano .setText(strDate);
			dateFinish = cal.getTime();
	        dataFinish2=cal1.getTime();
		}
		@Override
		public void onClick(View v) {
			// TODO Auto-generated method stub
			int id=v.getId();
			switch (id) {
			case R.id.btnthemluunno:
				
				break;
			case R.id.btnluuno:
				break;
			case R.id.tgblaimuon:
				break;
			default:
				break;
			}
		}
        public String Invalid()
        {
        	return "";
        }
}
